import { VuexModule, Module, Mutation, getModule } from 'vuex-module-decorators'
import store from '@/store'

export interface ThemeState {
    close: boolean // slide-menu是否关闭位
    color: string // 选择颜色样式
    padding: string // 选择padding样式
}

/** 定义模块内容 */
@Module({ dynamic: true, store, name: 'theme' })
class Theme extends VuexModule implements ThemeState {
    public close = false
    public color = '#f7f8f8'
    public padding = '60px'

    @Mutation
    public SET_CLOSE(flag: boolean) {
        this.close = flag
    }

    @Mutation
    public SET_COLOR(color: string) {
        this.color = color
    }

    @Mutation
    public SET_PADDING(padding: string) {
        this.padding = padding
    }
}

export const themeModule = getModule(Theme)
